;;;;; bing
(setq bing "https://cn.bing.com/search?q=")
(setq bing_dict "https://cn.bing.com/dict/search?q=")

;;; google
(setq google "http://www.google.com/search?q=")


(defun eww_search ()
  (interactive)
  (let* ((regexp (grep-read-regexp))
	 (buffer-name (message "se-%s-%s"
			 regexp
		 default-directory))
	 (old-default-dir default-directory))
    (switch-to-buffer-other-window (other-buffer))
    (eww (message "%s%s"
		  bing
		  regexp) )
    (rename-buffer buffer-name)
		(setq default-directory
					old-default-dir)
		(setq mode-line-format
					(list
					 "%b"))))



(defun eww_home ()
  (interactive)
  (eww bing))



(defun dict_search ()
  (interactive)
  (let* ((regexp (grep-read-regexp))
	 (buffer-name (message "ds-%s-%s"
			 regexp
		 default-directory))
	 (old-default-dir default-directory))
    (switch-to-buffer-other-window (other-buffer))
    (eww (message "%s%s"
			bing_dict
			regexp) )
    (rename-buffer buffer-name)
		(setq default-directory
					old-default-dir)
		(setq mode-line-format
					(list
					 "%b"))))



(evil-leader/set-key
  "es" 'eww_search
  "ds" 'dict_search
  "eb" 'eww-back-url
  "eh" 'eww_home)




(message "my_eww")
(provide 'my_eww)



